<?php

/**
 * WeEngine System
 *
 * (c) We7Team 2021 <https://www.w7.cc>
 *
 * This is not a free software
 * Using it under the license terms
 * visited https://www.w7.cc for more details
 */

namespace App\Http\Logic;

use Illuminate\Support\Str;

class UserLogic
{
    /**
     * Generate password
     *
     * @param string $password
     * @param string $salt
     * @return string
     */
    public static function makePassword(string $password, string $salt): string
    {
        return md5(md5($password) . $salt);
    }

    /**
     * Generate salt value
     *
     * @return string
     */
    public static function makeSalt(): string
    {
        return Str::random(8);
    }
}
